import http from "@/utils/request";

//查询订单
export const getOrder = () => http.post("/order/get_order");

//删除订单
export const delOrder = (order_id) =>
  http.get("/order/del_order", {
    params: {
      order_id,
    },
  });

//获取vip产品
export const getVipOrder = () =>
  http.get("/product/get_product", {
    params: {
      category_id: "20210827165510715",
    },
  });

//获取商品信息
export const getProductInfo = (product_id) =>
  http.get("/product/get_product", {
    params: {
      product_id,
    },
  });

//下单
export const preOrder = (product_id, quantity) =>
  http.post("/order/pre_order", { product_id, quantity });

//获取支付地址
export const pay = (order_id) =>
  http.post("/pay/payment", {
    order_id,
  });

//获取订单详情
export const getOrderDetai = (order_id) =>
  http.post("/order/get_order", {
    order_id,
  });

//查询支付结果
export const getOrderStatus = (order_id) =>
  http.get("/order/query_order_status", { params: { order_id } });
